<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>12.递归附加参数使用技巧</title>
</head>

<body>
  <script>
    //使用递归修改课程点击数
    let lessons = [
      {
        title: "媒体查询响应式布局",
        click: 89
      },
      {
        title: "FLEX 弹性盒模型",
        click: 45
      },
      {
        title: "GRID 栅格系统",
        click: 19
      },
      {
        title: "盒子模型详解",
        click: 29
      }
    ];
    function change(lessons,num =100,i =0) {
      if(i==lessons.length){
        return  lessons;
      }
      lessons[i].click += num;
      return(change(lessons,num,++i))
    }
    console.log(change(lessons,40));
  </script>
</body>

</html>